using System;
using System.Text;

namespace RealState.BusinessObjects
{
	[Serializable()]
	public class Contents
	{

        private int _Rownum;

        public int Rownum
        {
            get { return _Rownum; }
            set { _Rownum = value; }
        }


        private string _CategoriesName;

        public string CategoriesName
        {
            get { return _CategoriesName; }
            set { _CategoriesName = value; }
        }

        private string _Code;

        public string Code
        {
            get { return _Code; }
            set { _Code = value; }
        }

        private int _Id;

        public int Id
        {
            get { return _Id; }
            set { _Id = value; }
        }

        private string _Title;

        public string Title
        {
            get { return _Title; }
            set { _Title = value; }
        }

        private string _Content;

        public string Content
        {
            get { return _Content; }
            set { _Content = value; }
        }

        private string _ImgPath;

        public string ImgPath
        {
            get { return _ImgPath; }
            set { _ImgPath = value; }
        }

        private Nullable<int> _CategoryId;

        public Nullable<int> CategoryId
        {
            get { return _CategoryId; }
            set { _CategoryId = value; }
        }

        private string _Duration;

        public string Duration
        {
            get { return _Duration; }
            set { _Duration = value; }
        }

        private Nullable<int> _DistrictId;

        public Nullable<int> DistrictId
        {
            get { return _DistrictId; }
            set { _DistrictId = value; }
        }

        private Nullable<int> _CityId;

        public Nullable<int> CityId
        {
            get { return _CityId; }
            set { _CityId = value; }
        }

        private DateTime _CreatedTime;

        public DateTime CreatedTime
        {
            get { return _CreatedTime; }
            set { _CreatedTime = value; }
        }

        private int _UserID;

        public int UserID
        {
            get { return _UserID; }
            set { _UserID = value; }
        }

        private bool _IsActive;

        public bool IsActive
        {
            get { return _IsActive; }
            set { _IsActive = value; }
        }

        private bool _IsRemove;

        public bool IsRemove
        {
            get { return _IsRemove; }
            set { _IsRemove = value; }
        }

        private Nullable<int> _TradeTypeId;

        public Nullable<int> TradeTypeId
        {
            get { return _TradeTypeId; }
            set { _TradeTypeId = value; }
        }

        private Nullable<int> _ContentTypeID;

        public Nullable<int> ContentTypeID
        {
            get { return _ContentTypeID; }
            set { _ContentTypeID = value; }
        }

        private bool _IsSpecial;

        public bool IsSpecial
        {
            get { return _IsSpecial; }
            set { _IsSpecial = value; }
        }
        public Contents()
        { }

        public Contents(int Id, string Title, string Content, string ImgPath, Nullable<int> CategoryId, string Duration, Nullable<int> DistrictId, Nullable<int> CityId, DateTime CreatedTime, int UserID, bool IsActive, bool IsRemove, Nullable<int> TradeTypeId, Nullable<int> ContentTypeID, bool IsSpecial, string Code)
        {
            this.Id = Id;
            this.Title = Title;
            this.Content = Content;
            this.ImgPath = ImgPath;
            this.CategoryId = CategoryId;
            this.Duration = Duration;
            this.DistrictId = DistrictId;
            this.CityId = CityId;
            this.CreatedTime = CreatedTime;
            this.UserID = UserID;
            this.IsActive = IsActive;
            this.IsRemove = IsRemove;
            this.TradeTypeId = TradeTypeId;
            this.ContentTypeID = ContentTypeID;
            this.IsSpecial = IsSpecial;
            this.Code = Code;
        }

        public override string ToString()
        {
            return "Id = " + Id.ToString() + ",Title = " + Title + ",Content = " + Content + ",ImgPath = " + ImgPath + ",CategoryId = " + CategoryId.ToString() + ",Duration = " + Duration + ",DistrictId = " + DistrictId.ToString() + ",CityId = " + CityId.ToString() + ",CreatedTime = " + CreatedTime.ToString() + ",UserID = " + UserID.ToString() + ",IsActive = " + IsActive.ToString() + ",IsRemove = " + IsRemove.ToString() + ",TradeTypeId = " + TradeTypeId.ToString() + ",ContentTypeID = " + ContentTypeID.ToString() + ",IsSpecial = " + IsSpecial.ToString();
        }

        public class IdComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public IdComparer()
            { }
            public IdComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.Id.CompareTo(x.Id);
                }
                else
                {
                    return x.Id.CompareTo(y.Id);
                }
            }
            #endregion
        }
        public class TitleComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public TitleComparer()
            { }
            public TitleComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.Title.CompareTo(x.Title);
                }
                else
                {
                    return x.Title.CompareTo(y.Title);
                }
            }
            #endregion
        }
        public class ContentComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public ContentComparer()
            { }
            public ContentComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.Content.CompareTo(x.Content);
                }
                else
                {
                    return x.Content.CompareTo(y.Content);
                }
            }
            #endregion
        }
        public class ImgPathComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public ImgPathComparer()
            { }
            public ImgPathComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.ImgPath.CompareTo(x.ImgPath);
                }
                else
                {
                    return x.ImgPath.CompareTo(y.ImgPath);
                }
            }
            #endregion
        }
        public class DurationComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public DurationComparer()
            { }
            public DurationComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.Duration.CompareTo(x.Duration);
                }
                else
                {
                    return x.Duration.CompareTo(y.Duration);
                }
            }
            #endregion
        }
        public class CreatedTimeComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public CreatedTimeComparer()
            { }
            public CreatedTimeComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.CreatedTime.CompareTo(x.CreatedTime);
                }
                else
                {
                    return x.CreatedTime.CompareTo(y.CreatedTime);
                }
            }
            #endregion
        }
        public class UserIDComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public UserIDComparer()
            { }
            public UserIDComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.UserID.CompareTo(x.UserID);
                }
                else
                {
                    return x.UserID.CompareTo(y.UserID);
                }
            }
            #endregion
        }
        public class IsActiveComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public IsActiveComparer()
            { }
            public IsActiveComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.IsActive.CompareTo(x.IsActive);
                }
                else
                {
                    return x.IsActive.CompareTo(y.IsActive);
                }
            }
            #endregion
        }
        public class IsRemoveComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public IsRemoveComparer()
            { }
            public IsRemoveComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.IsRemove.CompareTo(x.IsRemove);
                }
                else
                {
                    return x.IsRemove.CompareTo(y.IsRemove);
                }
            }
            #endregion
        }

        public class IsSpecialComparer : System.Collections.Generic.IComparer<Contents>
        {
            public SorterMode SorterMode;
            public IsSpecialComparer()
            { }
            public IsSpecialComparer(SorterMode SorterMode)
            {
                this.SorterMode = SorterMode;
            }
            #region IComparer<Contents> Membres
            int System.Collections.Generic.IComparer<Contents>.Compare(Contents x, Contents y)
            {
                if (SorterMode == SorterMode.Ascending)
                {
                    return y.IsSpecial.CompareTo(x.IsSpecial);
                }
                else
                {
                    return x.IsSpecial.CompareTo(y.IsSpecial);
                }
            }
            #endregion
        }
	}
}
